<%-- 
    Document   : listado_etapas
    Created on : 11/11/2013, 06:44:01 PM
    Author     : Jorge.correa
--%>

<%@page import="java.util.Vector"%>
<%@page import="Conexion.GestionSQL"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<%
    String strCodigo = request.getParameter("txtCodigo");
    String strSQL="";
    String[] strTemp=null;
    Vector arrFechas = new Vector();
    Vector arrNombres = new Vector();
    Vector arrConsecutivos = new Vector();
    Vector arrIds = new Vector();
    
    strSQL = "select exs.txtConsecutivo, exs.txtIdEtapa, e.txtNombre, exs.dtFechaRegistro from tbl_etapas_x_solicitud exs, tbl_etapas e where (exs.txtIdEtapa = e.txtCodigo) and exs.txtIdSol = '" + strCodigo + "' ORDER BY CAST(exs.txtConsecutivo AS SIGNED)";
    Vector arrDatos = GestionSQL.consultaSQL(strSQL, "4");
    
    for(int i=0;i<arrDatos.size();i++){
        strTemp = arrDatos.get(i).toString().split(">");
        arrConsecutivos.add(strTemp[0]);
        arrIds.add(strTemp[1]);
        arrNombres.add(strTemp[2]);
        arrFechas.add(strTemp[3]);
    }
    
%>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link rel="SHORTCUT ICON" href="Images/App.ico" />
        <link rel="stylesheet" type="text/css" href="Styles/forms.css" />
        <script type="text/javascript" src="Scripts/jquery-1.7.2.min.js"></script>
        <script type="text/javascript" charset="UTF-8" src="Scripts/ajax.js"></script>  
        <script type="text/javascript" charset="UTF-8" src="Scripts/add_etapa.js"></script>
        <title>Sistema de Consulta a la Plataforma SIU - Etapas de la solicitud</title>
    </head>
    <body>
        <header>
            <jsp:include page="header.jsp" />  
       </header>
       <section>
            <div align="center">
                <br><br>
                <table cellspacing="0" cellpadding="0" border="0" class="TABLACONTENEDORA" style="width: 600px;">
                        <tr>
                            <td class="TITULOFORM">ETAPAS DE LA SOLICITUD #<%=strCodigo%></td>
                        </tr>                
                        <tr>
                            <td>                                        
                                    <table cellspacing="0" cellpadding="4" border="0" class="TABLAMAESTRO" style="width: 600px;">                  
                                        <tr>
                                            <td class="SUBTITULOFORM" style="border-right: 1px solid #116043">Consecutivo de la etapa</td>
                                            <td class="SUBTITULOFORM" style="border-right: 1px solid #116043">Nombre de la etapa</td>
                                            <td class="SUBTITULOFORM" style="border-right: 1px solid #116043">Fecha de registro<br>(aaaa-mm-dd)</td>
                                            <td class="SUBTITULOFORM">Acción</td>
                                        </tr>
                                        <% for(int i=0;i<arrConsecutivos.size();i++){%>
                                            <tr>                                     
                                                <td class="DATOREPORTE" style="text-align: center;width: 150px;border-right: 1px solid #116043"><%=arrConsecutivos.get(i)%></td>
                                                <td class="DATOREPORTE" style="text-align: center;width: 150px;border-right: 1px solid #116043"><%=arrNombres.get(i)%></td>
                                                <td class="DATOREPORTE" style="text-align: center;width: 150px;border-right: 1px solid #116043"><%=arrFechas.get(i)%></td>
                                                <td class="DATOREPORTE" style="text-align: center;">
                                                    <input type="button" id="btnVerDetalle" value="Ver detalle" onclick="verDetalle('<%=arrConsecutivos.get(i)%>','<%=arrIds.get(i)%>','<%=strCodigo%>');" class="BOTONFORM" />
                                                </td>
                                            </tr>
                                        <%}%>                      
                                        <tr>
                                            <td colspan="4" class="CELDABOTONFORM">
                                                <input type="button" value="Salir" class="BOTONFORM" onclick="javascript:window.close();" />
                                            </td>
                                        </tr>
                                    </table>
                            </td>
                        </tr>
                </table>
            </div>
        </section>
       <footer>        
        <div id="dFooter" class="FOOTER">
            <jsp:include page="footer.jsp" />          
        </div>
       </footer>
    </body>
</html>
